<template>
	<div >
		<div class="graybg"></div>
		<!--头部-->
		<header id="header">
			<div class="header header_bg clearfix">
				<div class="header_left pull-left">
					<i class="iconfont baiColor" onclick="javascript:history.back(-1)">&#xe612;</i>
					<span></span>
				</div>
				<div class="header_center baiColor">积分</div>
			</div>
		</header>
		<div class="main">
			<div class="money header_bg _width">
				<div class="money_top">
					<router-link to="/alldetail/3">
					<h3 class="baiColor" v-text="money"></h3>
					<p class="baiColor">活积分</p>
					</router-link>
				</div>
				<div class="money_bottom">
					<div class="money_bottom_each">
						<router-link to="/copy">
							<h4 v-text="integral01"></h4>
							<h5>复消积分</h5>
						</router-link>
					</div>
					<div class="money_bottom_each">
						<router-link to="/alldetail/1">
						<h4 v-text="integral02"></h4>
						<h5>冻积分</h5>
						</router-link>
					</div>
				</div>
			</div>
			<!--==-->
			<div class="performance marginAuto">
				<div class="performance_each">
					<h4 class="ellipsis01" v-text="increased"></h4>
					<h4>本月新增</h4>
				</div>
				<div class="performance_each">
					<h4 class="ellipsis01" v-text="all"></h4>
					<h4>总业绩</h4>
				</div>
			</div>
			<div class="list marginAuto">
				<router-link to="/wdeposit">
				<div class="item marginAuto clearfix">
					<span class="iconfont pull-left">&#xe692;</span>
					<em class="pull-left">广告收益</em>
					<i class="iconfont pull-right">&#xe615;</i>
				</div>
				</router-link>
			</div>
		</div>
	</div>
</template>

<script>
	
	export default{
		data(){
			return{
				money:"00.00",	//活积分
				integral01:"0.00",	//复消积分
				integral02:"0.00",	//冻积分
				increased:"0.00", //本月新增
				all:"00.00", //总业绩
			}
		},
		mounted(){
			var info = window.localStorage.data;
			var params = new URLSearchParams();
			params.append('token', info);
			this.$axios({
			   url:"Home/Egral/egral_index",
				method:"post",
				data:params
			   }).then((res)=>{
			   	let datas = res.data;
			   	if(datas.code == 1){
			   		this.money = datas.data.egral_huo;
			   		this.integral01 = datas.data.egral_fu;
			   		this.integral02 = datas.data.egral_dong;
			   		this.increased = datas.data.egral_m;
			   		this.all = datas.data.egral_all;
			   	}else if(datas.code == 0){
			   		alert("获取数据失败，请重新获取")
			   	}else if(datas.code == 2){
			   		alert("数据为空")
			   	}
			}).catch(function(err){
				console.log(err)		
			})
		}
		
	}
</script>

<style scoped="scoped">
	@import "../css/public.css";
	@import "../css/wintegral.css";
</style>